Skip to content

Adds some snippets in devsite that were missing and fixes a snippet start tag. #394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 2, 2024

Conversation

morganchen12
Copy link
Contributor

No description provided.

@morganchen12 morganchen12 merged commit 3511cb8 into master May 2, 2024
@morganchen12 morganchen12 deleted the mc/vertex branch May 2, 2024 21:17

// Initialize the generative model with a model that supports your use case
// Gemini 1.5 Pro is versatile and can accept both text-only or multimodal prompt inputs
let model = vertex.generativeModel(modelName: "{{generic_model_name_initialization}}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for includecode and the snippet registry to work with DevSite variables like this?

{{generic_model_name_initialization}}

If so, could we pls change the explicit insertion of a model name in the other snippets to use this variable, too? :-D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. It depends on which templating thing runs first in devsite. I put this here without checking, but I can try it out in staging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does work!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted this snippet and updated all others to use the template.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried moving these into the docs today and it doesn't work. Can't remember what I did to test that made them work.

let vertex = VertexAI.vertexAI()

// Initialize the generative model with a model that supports your use case
// Gemini 1.5 Pro is versatile and can accept both text-only or multimodal prompt inputs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Gemini 1.5 models are versatile and can be used with all API capabilities

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -39,6 +39,63 @@ class Snippets {
self.model = model
}

func templateInitializeModel() {
// [START template_initialize_model]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the snippet registry... would we use this initialization snippet or the one added with #392?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved with the deletion of the other snippet and conversion of all snippets to template model name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants